<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'/>
    <title>主页</title>
    <script src="/js/jquery-3.2.1.js"></script>
    <link type="text/css" href="../css/bootstrap.css" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="../css/style.css">

    <style>
        * {
            /* Basic CSS reset */
            margin: 0;
            padding: 0;
        }

        body {
            /* These styles have nothing to do with the ribbon */
            /*background-color: black;*/
            background: url("/img/dark_wood.png") 0 0 repeat;
            padding: 35px 0 0;
            margin: auto;
            text-align: center;
        }

        .ribbon {
            display: inline-block;
        }

        .ribbon:after, .ribbon:before {
            margin-top: 0.5em;
            content: "";
            float: left;
            border: 1.5em solid #fff;
        }

        .ribbon:after {
            border-right-color: transparent;
        }

        .ribbon:before {
            border-left-color: transparent;
        }

        .ribbon a:link, .ribbon a:visited {
            color: #000;
            text-decoration: none;
            float: left;
            height: 3.5em;
            overflow: hidden;
        }

        .ribbon span {
            background: #fff;
            display: inline-block;
            line-height: 3em;
            padding: 0 1em;
            margin-top: 0.5em;
            position: relative;

            -webkit-transition: background-color 0.2s, margin-top 0.2s; /* Saf3.2+, Chrome */
            -moz-transition: background-color 0.2s, margin-top 0.2s; /* FF4+ */
            -ms-transition: background-color 0.2s, margin-top 0.2s; /* IE10 */
            -o-transition: background-color 0.2s, margin-top 0.2s; /* Opera 10.5+ */
            transition: background-color 0.2s, margin-top 0.2s;
        }

        .ribbon a:hover span {
            background: #FFD204;
            margin-top: 0;
        }

        .ribbon span:before {
            content: "";
            position: absolute;
            top: 3em;
            left: 0;
            border-right: 0.5em solid #9B8651;
            border-bottom: 0.5em solid #fff;
        }

        .ribbon span:after {
            content: "";
            position: absolute;
            top: 3em;
            right: 0;
            border-left: 0.5em solid #9B8651;
            border-bottom: 0.5em solid #fff;
        }

    </style>
</head>
<body style="background-color: #2a2b2c">
<div class="container">

    <div class="row">
        <div class='ribbon'>
            <a href='/home'><span>Home</span></a>
            <a href='#'><span>MyBlog</span></a>
            <a href='#'><span>Services</span></a>
            <a href='/write'><span>Write</span></a>
        </div>
    </div>


    <div class="row">
        <div class="col-sm-12">
            <table id="tab" class="table" style="color: white ; margin: 50px auto ; line-height: 30px">
                <tr>
                    <td>作者</td>
                    <td>标题</td>
                    <td>简介</td>
                    <td>操作</td>
                </tr>

            </table>
        </div>
    </div>

    <div class="row">

    </div>


</div>

<script src="/js/jquery-3.2.1.js"></script>

<script>

            $.ajax({
                url:"/showmyblog",
                type:"get",
                success:function (result) {

                    for (var i=0; i<result.length;i++){
                        var blog = result[i];
                        var id = blog.bid;
                        var td4 = $("<td></td>").html("<a href='/showblog?bid="+id+"'>查看</a><a href='/showblog?bid=\"+id+\"'>删除</a>");
                        var td3 = $("<td></td>").text(blog.des);
                        var td2 = $("<td></td>").text(blog.title);
                        var td1 = $("<td></td>").text(blog.uid);
                        var tr = $("<tr></tr>").append(td1, td2, td3, td4);

                        $("#tab").append(tr);

                    }
                }
            })



</script>
</body>
</html>